package com.csjung.games.gamenori.client.ioc;

import com.google.gwt.storage.client.Storage;
import com.google.gwt.user.client.Window;
import com.google.inject.Provider;

public class StorageProvider implements Provider<Storage> {
  @Override
  public Storage get() {
    String storageUrlValue = Window.Location.getParameter("storage");
    if (storageUrlValue == null || storageUrlValue.startsWith("t")) {
      return Storage.getLocalStorageIfSupported();
    } else {
      return null;
    }
  }
}
